package ru.kvolkov.myreader.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;

/** 
 * Represents a base MyReader activity class. 
 * This activity does not have title.
 */
public abstract class BaseActivity 
extends Activity
implements OnClickListener {
    /** 
     * Called when the activity is first created. 
     */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
	}
	
	/**
	 * Registers this activity as on click listener for view with specified id. 
	 */
	protected void registerOnClickListener(int id) {
		registerOnClickListener(id, this);
	}
	
	/**
	 * Registers specified activity as on click listener. 
	 */
	protected void registerOnClickListener(int id, OnClickListener listener) {
		View view = findViewById(id);
		view.setOnClickListener(listener);
	}

	/**
	 * Called when activity element was clicked.
	 */
	@Override
	public void onClick(View view) {
	}
}
